CellIsValidInteger Function

private function CellIsValidInteger(i, j, grid)

return false if cell is out of grid either contains nodata value, true otherwise.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: i
integer, intent(in) :: j
type(grid_integer), intent(in) :: grid

Return Value logical


Source Code

LOGICAL FUNCTION CellIsValidInteger &
!
(i, j, grid) 

IMPLICIT NONE

!Arguments with intent in:
INTEGER, INTENT(IN) :: i,j
TYPE (grid_integer), INTENT(IN) :: grid

!----------------------end of declarations-------------------------------------

CellIsValidInteger = .TRUE.

IF ( IsOutOfGrid (i, j, grid) ) THEN
  CellIsValidInteger = .FALSE.
  RETURN
ELSE
   IF ( grid % mat (i,j) == grid % nodata ) THEN
      CellIsValidInteger = .FALSE.
   ELSE
      CellIsValidInteger = .TRUE.
   END IF
END IF
 
RETURN
END FUNCTION CellIsValidInteger